program zgc;

{$mode objfpc}{$H+}

uses
  Classes,
  SysUtils,
  caozuowenjian,
  leixing_changliang,
  cuowubianma,
  tiquyuju,
  fanyidaima_zhongjian;

var
  fyuanwenjian: wenjian_leixing;
  fyuan_lujing: zichuan_leixing;
  fmubiaowenjian: wenjian_leixing;
  fmubiao_lujing: zichuan_leixing;
  ayuandaima_hang: zichuan_leixing;
  azhongjiandaima_hang: zichuan_leixing;
begin
  fyuan_lujing := ParamStr(1);
  fmubiao_lujing := ParamStr(2);
  if buchenggong_changliang = dakai_wenjian(@fyuanwenjian, fyuan_lujing) then
  begin
    shuchucuowu(zhaobudaoyuanwenjian_cuowu);
    Exit;
  end;
  chuangjian_wenjian(@fmubiaowenjian, fmubiao_lujing);
  try
    while shifoujiewei_wenjian(@fmubiaowenjian) do
    begin
      ayuandaima_hang := fanhuiyihang_yuju(@fyuanwenjian);
      azhongjiandaima_hang := fanyi_zhongjian(ayuandaima_hang);
      xieru_wenjian(@fmubiaowenjian, azhongjiandaima_hang);
    end;
  finally
    guanbi_wenjian(@fmubiaowenjian);
    guanbi_wenjian(@fyuanwenjian);
  end;
end.
